package com.github.tetrisgame.ui.activity;

import android.content.Intent;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.github.tetrisgame.R;
import com.github.tetrisgame.base.BaseActivity;
import com.github.tetrisgame.databinding.ActivityAdvertisementBinding;
import com.github.tetrisgame.ui.view.JumpView;

public class AdvertisementActivity extends BaseActivity<ActivityAdvertisementBinding> {
    @Override
    public ActivityAdvertisementBinding initBinding() {
        return ActivityAdvertisementBinding.inflate(getLayoutInflater());
    }

    @Override
    public void initUI() {
        mBinding.jumpView.setOnEventListener(new JumpView.OnEventListener() {
            @Override
            public void onAnimationEnd() {
                startActivity(new Intent(AdvertisementActivity.this, LoginActivity.class));
            }

            @Override
            public void onClicked() {
                startActivity(new Intent(AdvertisementActivity.this, LoginActivity.class));
            }
        });


        mBinding.progressView.addOnClickCallback(view -> {
            startActivity(new Intent(AdvertisementActivity.this, LoginActivity.class));
            return null;
        });
        mBinding.main.setOnClickListener(v -> {
            mBinding.jumpView.start();
            mBinding.progressView.start(() -> {
                startActivity(new Intent(AdvertisementActivity.this, LoginActivity.class));
                return null;
            });
        });
    }
}